<template>
  <!-- 选择我的爱车 -->
  <view class="content">
    <view class="selecboxsimg font-26 flex flex-ai-c" v-show="selectShow !== 1">
      <view class="imgbrands">
        <image :src="'https://files.yzsheng.com/goodimg/brandimg/'+bid+'.png'" mode="aspectFit"></image>
      </view>
      <view class="flex flex-ai-c flex-wrap-w">
        <view class="brandsboxs color-333" @click="delcar(1)">
          {{brand}}
        </view>
        <view class="flex flex-ai-c" @click="delcar(2)">
          <view class="xiant ml-10"></view>
          <view class="1234 color-FBB000 ml-10" v-if="selectShow === 2">
            车系
          </view>
          <view class="ml-10" v-if="selectShow === 3 || selectShow === 4 ||selectShow === 5||selectShow === 6">
            {{serlsit}}
          </view>
        </view>
        <view class="flex flex-ai-c" @click="delcar(3)">
          <view class="xiant ml-10" v-if="selectShow === 3 || selectShow === 4 || selectShow === 5||selectShow === 6"></view>
          <view class="1234 color-FBB000 ml-10" v-if="selectShow === 3">
            排量
          </view>
          <view class="ml-10" v-if="selectShow === 4 || selectShow === 5||selectShow === 6">
            {{prands}}
          </view>
        </view>
        <view class="flex flex-ai-c" @click="delcar(4)">
          <view class="xiant ml-10" v-if="selectShow === 4 || selectShow === 5||selectShow === 6"></view>
          <view class="1234 color-FBB000 ml-10" v-if="selectShow === 4">
            年款
          </view>
          <view class="ml-10" v-if="selectShow ===5||selectShow === 6">
            {{years}}
          </view>
        </view>
        <view class="flex flex-ai-c" @click="delcar(5)">
          <view class="xiant ml-10" v-if="selectShow === 5||selectShow === 6"></view>
          <view class="1234 color-FBB000 ml-10" v-if="selectShow === 5">
            版本
          </view>
          <view class="ml-10" v-if="selectShow === 6">
            {{Configuname}}
          </view>
        </view>
        <view class="flex flex-ai-c">
          <view class="xiant ml-10" v-if="selectShow === 6"></view>
          <view class="1234 color-FBB000 ml-10" v-if="selectShow === 6">
            车牌号
          </view>
          <view class="ml-10" v-if="selectShow === 7">
            {{licenseplate}}
          </view>
        </view>
      </view>
    </view>
    <!-- 品牌 -->
    <view v-show="selectShow === 1" class="brands">
      <scroll-view scroll-y="true" style="height: 100vh;" :scroll-into-view="addtoView">
        <view class="headtext font-34 color-333 ml-20">
          品牌
        </view>
        <view class="history">
          <view class="weiyouchey" v-show="!historylistpp">
            未有浏览任何车源，快去看看吧...
          </view>
          <view class="1234">
            热门品牌
          </view>
          <view class="flex flex-wrap-w">
            <view class="hisxbox" v-for="(item, index) in historylistpp" :key="index" @tap="searchBrand(item,0)">
              <view class="imgbrand">
                <image :src="'https://files.yzsheng.com/goodimg/brandimg/'+item.brandId+'.png'" mode="aspectFit"></image>
              </view>
              <view class="histext">{{item.branName}}</view>
            </view>
          </view>
        </view>
        <view class="boxsds">
          <view v-for="(item, index) in Brandlist" :id="item.initial" :key="item.initial">
            <view class="abcd">
              {{item.initial}}
            </view>
            <view class="Brandcsss">
              <view class="list-cell" v-for="(item1, index1) in item.data" :key="index1">
                <view class="brandcss" @tap="searchBrand(item1,1)">
                  <view class="iconimgs">
                    <image :src="'https://files.yzsheng.com/goodimg/brandimg/'+item1.bid+'.png'" mode="aspectFit"></image>
                  </view>
                  <view class="area">{{item1.brand}}</view>
                </view>
              </view>
            </view>
          </view>
          <view class="floor">
            <view v-for="(item,index) in indexlist" :data-id="item" :key="index" @tap="addressToView">
              {{item}}
            </view>
          </view>
        </view>
      </scroll-view>
    </view>
    <!-- 系列 -->
    <view v-show="selectShow === 2" class="xilie">
      <view class="ppbox">
        <view class="containepp">
          <view class="num">{{brand}}</view>
          <view class="bjcolor" style="padding: 0rpx 20rpx;height: 100%;margin-top: 0px;">
            <view class="list-cell" v-for="(item, index) in Serieslist" :key="index" @tap="seriesbtn(item)">
              <text class="name">{{item.carTypeName}}</text>
            </view>
          </view>
        </view>
      </view>
    </view>
    <!-- 排量 -->
    <view v-show="selectShow === 3" class="xilie">
      <view class="ppbox mt-20">
        <view class="containepp">
          <view class="bjcolor" style="padding: 0rpx 20rpx;height: 100%;margin-top: 0px;">
            <view class="list-cell" v-for="(item, index) in displacement" :key="index" @tap="sdisplacementbtn(item)">
              <text class="name" v-if="item.displacement !== '-1'">{{item.displacement}}</text>
              <text class="name" v-else>电动/混动</text>
            </view>
          </view>
        </view>
      </view>
    </view>
    <!-- 年款 -->
    <view v-show="selectShow === 4" class="xilie">
      <view class="ppbox">
        <view class="containepp">
          <view class="num">{{brand}}</view>
          <view class="bjcolor" style="padding: 0rpx 20rpx;height: 100%;margin-top: 0px;">
            <view class="list-cell" v-for="(item, index) in modelyear" :key="index" @tap="modelyearbtn(item)">
              <text class="name">{{item.data}}</text>
            </view>
          </view>
        </view>
      </view>
    </view>
    <!-- 车子 -->
    <view v-show="selectShow === 5" class="carname">
      <view class="ppbox1">
        <view class="containepp">
          <view class="1234 mt-20">
            <view class="bjcolor" style="padding: 0rpx 20rpx;margin-top: 0rpx" v-if="isShow===1">
              <view class="list-cell" v-for="(item, index) in Configurationlist" :key="index" @tap="Configbtn(item)">
                <view class="name1">{{item.name}}</view>
              </view>
            </view>
						
						<view class="bjcolor" style="padding: 0rpx 20rpx;margin-top: 0rpx" v-else>
						  <view class="list-cell" v-for="(item, index) in Configurationlist" :key="index" @tap="addCar(item)">
						    <view class="name1">{{item.name}}</view>
						  </view>
						</view>
          </view>
        </view>
      </view>
    </view>
		<u-toast ref="uToast" />
	</view>
</template>


<script src="./addYourCar.js"></script>
<style lang="scss" scoped>
  @import './addYourCar.scss';
</style>
